package com.example.picturestorage.test;

import java.io.File;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

public class JiShi {

    public static void main(String[] args) {
        LocalDateTime localDateTime=LocalDateTime.now();
        LocalDate of = LocalDate.of(1, 1, 1);
    }

    //最小公倍数
    public static class Main1 {
        public static void main(String[] args) {
            int a = 5;
            int b = 7;
            int max = Integer.max(a, b);
            int min = Integer.min(a, b);
            for (int i = 1; i <= min; i++) {
                int temp = max * i;
                if (temp % a == 0) {
                    System.out.println("最小公倍数为：" + temp);
                    break;
                }
            }
//            int[] arr={1,2,3};
//            Arrays.sort(arr);
//            String s="111,33";
//            boolean contains = s.contains(",");
//            List<Integer> list = Arrays.asList(1, 2, 3);
//            System.out.println("list = " + list);
//            List<String> list1 = Arrays.asList("ASD", "asd sd", "rt,fg");
//            for (int i = 0; i < list1.size(); i++) {
//                String s1 = list1.get(i);
//                if(s1.contains(",")||s1.contains(" ")){
//                    list1.set(i,"\""+s1+"\"");
//                }
//            }
//            System.out.println("list1 = " + list1);
//            String s1 = list1.toString();
//            System.out.println("s1 = " + s1);
//            String substring = s1.substring(1, s1.length() - 1);
//            System.out.println("substring = " + substring);

            List<Integer> list1 = Arrays.asList(1, 2, 3);
            Object[] objects = list1.toArray();


            Scanner in = new Scanner(System.in);
            while (in.hasNext()) {
                int total = in.nextInt();
                in.nextLine();
                List<String> list = new ArrayList<>();
                for (int i = 0; i < total; i++) {
                    String s = in.nextLine();
//                    if (!s.equals("\n"))
                    list.add(s);
                }
                for (int i = 0; i < list.size(); i++) {
                    String s = list.get(i);
                    if (s.contains(",") || s.contains(" ")) {
                        list.set(i, "\"" + s + "\"");
                    }
                }
                String result = list.toString();
                System.out.println(result.substring(1, result.length() - 1));
            }
        }
    }

    public static class Main2 {
        public static void main(String[] args) {
            long[] ints = {1, 2, 3, 4};
            List<long[]> ints1 = Arrays.asList(ints);
            List<Long> collect = Arrays.stream(ints).boxed().collect(Collectors.toList());
            collect.stream().forEach(e->{
                System.out.println("e = " + e);
            });

            int total = 12;
            String s = "3 9 3 2 5 6 7 3 2 3 3 3";
            String[] sArr = s.split(" ");
            List<Integer> list = Arrays.stream(sArr).filter(e -> !e.equals("")).map(Integer::parseInt).collect(Collectors.toList());
            Set<Integer> set = new HashSet<>(list);
            for (Integer i : set) {
                long count = list.stream().filter(e -> e.equals(i)).count();
                if (count >= (total / 2)) {
                    System.out.println(i);
                    break;
                }
            }

            char[] chars = "sdasd".toCharArray();
            String[] split = "asd  sdafdAA".split("");
            long count = Arrays.stream(split).filter(e -> e.charAt(0) >= 'A' && e.charAt(0) <= 'Z').count();
            System.out.println("count = " + count);
        }
    }

    public static class Main3 {
        public static void main(String[] args) {
            System.out.println("add(5) = " + add(5));
            List<File> fileList = new ArrayList<>();
            getFiles(new File("F:\\Downloads\\360Downloads"), fileList);
            fileList.forEach(System.out::println);
        }

        public static int add(int n) {
            if (n == 1) {
                return 1;
            }
            return n + add(n - 1);
        }

        public static void getFiles(File file, List<File> fileList) {
            if (file.isDirectory()) {
                File[] files = file.listFiles();
                for (File file1 : files) {
                    if (file1.isDirectory()) {
                        getFiles(file1, fileList);
                    } else {
                        fileList.add(file1);
                    }
                }
            } else {
                fileList.add(file);
            }

        }
    }

}
